package com.adv.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.adv.web.common.BaseController;
import com.adv.web.service.WsUtil;

@Controller
@RequestMapping(value = "/wx/login")
public class LoginController extends BaseController {


	/**
	 *  跳转到登录界面
	 *  @author Liyarong
	 */
	@RequestMapping(value = "toLogin")
	public String toLogin() {
		return "wx/login";
	}

	/**
	 * 检查用户名密码，获取登陆科室列表
	 * @param account |his账号|string|必填
	 * @param password |his账号密码|string|必填
	 * @return
	 */
	@RequestMapping(value = "checkAccount")
	@ResponseBody
	public String checkAccount(
			 @RequestParam String account,
			 @RequestParam String password
			) {
		String result="";
		StringBuffer par=new StringBuffer();
		par.append(account);
		par.append("^");
		par.append(password);
		try {
		    result =WsUtil.sendWebService("login", par.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}

}
